load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "pattern",
    srcs = [
        "engine.go",
        "pattern.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/planner/cascades/pattern",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/planner/core/base",
        "//pkg/planner/core/operator/logicalop",
    ],
)

go_test(
    name = "pattern_test",
    timeout = "short",
    srcs = [
        "engine_test.go",
        "pattern_test.go",
    ],
    embed = [":pattern"],
    flaky = True,
    shard_count = 5,
    deps = [
        "//pkg/planner/core/operator/logicalop",
        "@com_github_stretchr_testify//require",
    ],
)
